import { createApp } from 'vue'
import { createPinia } from 'pinia'
import router from './router/index.js'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './styles/index.css'
import App from './App.vue'

const app = createApp(App)

app.use(createPinia())
app.use(router)
app.use(ElementPlus)

// 全局错误处理，捕获所有子组件错误
app.config.errorHandler = (err, instance, info) => {
  console.log(err, instance, info)
}

// mount方法返回的是根组件实例，而非应用实例，在配置完之后调用
app.mount('#app')